package com.yulang.security;

import com.yulang.security.provider.AuthConfigProvider;
import org.springframework.core.annotation.Order;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer;
import org.springframework.stereotype.Component;

@Component
@Order(1)
public class WebConfigureProvider implements AuthConfigProvider {

    /*@Autowired
    private SysPermissionService sysPermissionService;*/

    @Override
    public void configure(ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry config) {
        /*List<SysPermission> list = sysPermissionService.list();
        for (SysPermission sysPermission : list) {
            if(StringUtils.isNotEmpty(sysPermission.getUrl()) ) {
                config.antMatchers(sysPermission.getUrl()).hasAuthority(sysPermission.getCode());
            }
        }*/
    }
}
